<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="father">
    <h1>什么都没有</h1>
    <p class="p1">p1</p>
    <p id="p2">p2</p>
</div>

<script>
    let father = document.getElementById("p2").parentElement;
    father.removeChild(father.children[0]);
</script>

</body>
</html>